<?php
require_once $_SERVER['DOCUMENT_ROOT'].'/home/config.php';

$array_return = array();
$array_return['status'] = 0;
$array_return['html'] = '';

$like_id = getValue('like_id','int','GET',0);
$style = getValue('style','str','GET','',2);
$like_type = getValue('like_type','str','GET','',2);
$array_return['html'] = $style.'-'.$like_id.'-'.$like_type;
if($style == 'like') {
   if($like_type == 'comment') {
      $db_inlike = new db_execute('UPDATE comments SET com_like = com_like + 1 WHERE com_id = '.$like_id);
   }elseif($like_type == 'reply') {
      $db_inlike = new db_execute('UPDATE comments_reply SET rep_like = rep_like + 1 WHERE rep_id = '.$like_id);
   }
}elseif($style == 'dislike') {
   if($like_type == 'comment') {
      $db_inlike = new db_execute('UPDATE comments SET com_like = com_like - 1 WHERE com_id = '.$like_id);
   }elseif($like_type == 'reply') {
      $db_inlike = new db_execute('UPDATE comments_reply SET rep_like = rep_like - 1 WHERE rep_id = '.$like_id);
   }
}
die(json_encode($array_return));
?>